﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Fluent="clr-namespace:Fluent" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
                    xmlns:Diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase">
  <ControlTemplate TargetType="{x:Type Fluent:GalleryItem}" x:Key="GalleryItemControlTemplate">       
          <Grid Background="{DynamicResource TransparentBrush}">
            <Border x:Name="hoverBorder" d:LayoutOverrides="Width, Height" BorderThickness="4" Visibility="Collapsed">
            	<Border.BorderBrush>
            		<SolidColorBrush Color="{Binding RibbonThemeColor.Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:MetroWindow}}}" Opacity="0.12"/>
				</Border.BorderBrush>               
			</Border>
            <Border x:Name="selectedBorder" d:LayoutOverrides="Width, Height" BorderThickness="4" Visibility="Collapsed">
            	<Border.BorderBrush>
            		<SolidColorBrush Color="{Binding RibbonThemeColor.Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:MetroWindow}}}" Opacity="0.2"/>
				</Border.BorderBrush>         
			</Border>
            <ContentPresenter x:Name="contentPresenter" Margin="1" Opacity="1"/>
            <Border x:Name="pressedBorder" BorderThickness="4" d:LayoutOverrides="Width, Height" Visibility="Collapsed">
            	<Border.BorderBrush>
            		<SolidColorBrush Color="{Binding RibbonThemeColor.Color, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:MetroWindow}}}" Opacity="0.3"/>
				</Border.BorderBrush>
			</Border>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter Property="Visibility" TargetName="selectedBorder" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
              <Setter Property="Visibility" TargetName="pressedBorder" Value="Visible"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
  <Style x:Key="GalleryItemStyle" TargetType="{x:Type Fluent:GalleryItem}">
    <Setter Property="Template" Value="{StaticResource GalleryItemControlTemplate}"/>
    <!--<Setter Property="Width" Value="{Binding ItemWidth, FallbackValue=0, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}, Diagnostics:PresentationTraceSources.TraceLevel=None}"/>
    <Setter Property="Height" Value="{Binding ItemHeight, FallbackValue=0, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Fluent:RibbonItemsControl}}, Diagnostics:PresentationTraceSources.TraceLevel=None}"/>-->
  	<Setter Property="FocusVisualStyle" Value="{DynamicResource ControlStyleEmptyFocus}"/>
  </Style>
</ResourceDictionary>